package site.wlwsjsx.iot_backend.dto;

import jakarta.validation.constraints.NotBlank;

public class EnvUploadDTO {
    /**
     * 设备类型：区分是实验室还是工位
     * 取值："lab"（实验室）、"workstation"（工位）
     */
    @NotBlank(message = "设备类型不能为空（lab/workstation）")
    private String deviceType;

    /**
     * 设备标识：
     * - 若deviceType=lab → 填实验室ID（lab_info表的id）
     * - 若deviceType=workstation → 填工位编号（workstation_info表的workstation_code）
     */
    @NotBlank(message = "设备标识不能为空（实验室ID/工位编号）")
    private String deviceId;

    private String username;
    /**
     * 温度值（℃）
     * 允许为null（若传感器未采集温度）
     */
    private Float temperature;

    /**
     * 湿度值（%）
     * 允许为null（若传感器未采集湿度）
     */
    private Float humidity;

    /**
     * 烟雾值（单位根据传感器定，如ppm）
     * 允许为null（若传感器未采集烟雾）
     */
    private Float smokeScope;

    /**
     * 光线强度（单位根据传感器定，如lux）
     * 仅工位传感器可能有，实验室可选
     */
    private Float lightIntensity;

    /**
     * 火焰检测值（0=无火焰，1=有火焰，或具体检测值）
     * 仅工位传感器可能有
     */
    private Float flameScope;

    public EnvUploadDTO() {
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public Float getTemperature() {
        return temperature;
    }

    public void setTemperature(Float temperature) {
        this.temperature = temperature;
    }

    public Float getHumidity() {
        return humidity;
    }

    public void setHumidity(Float humidity) {
        this.humidity = humidity;
    }

    public Float getSmokeScope() {
        return smokeScope;
    }

    public void setSmokeScope(Float smokeScope) {
        this.smokeScope = smokeScope;
    }

    public Float getLightIntensity() {
        return lightIntensity;
    }

    public void setLightIntensity(Float lightIntensity) {
        this.lightIntensity = lightIntensity;
    }

    public Float getFlameScope() {
        return flameScope;
    }

    public void setFlameScope(Float flameScope) {
        this.flameScope = flameScope;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "EnvUploadDTO{" +
                "deviceType='" + deviceType + '\'' +
                ", deviceId='" + deviceId + '\'' +
                ", username='" + username + '\'' +
                ", temperature=" + temperature +
                ", humidity=" + humidity +
                ", smokeScope=" + smokeScope +
                ", lightIntensity=" + lightIntensity +
                ", flameScope=" + flameScope +
                '}';
    }
}
